<extend name="Public:Base" />
<block name="content">
	<div class="main-title">
		<h2><eq name="ACTION_NAME" value='add'>新增<else />编辑</eq>节点 [ <A HREF="__URL__">返回列表</A> ]</h2>
	</div>
	<FORM METHOD="POST" id="form1" class="form-horizontal" action="__URL__/<eq name="ACTION_NAME" value="add">insert<else />update</eq>" enctype="multipart/form-data">
		<div class="form-item cf">
			<label class="item-label">节点名：<span class="check-tips">（输入行为标识 英文字母）</span></label>
			<div class="controls">
				<input type="text" class="text input-large" name="title" value="{$vo.title}" datatype="*" nullmsg="节点名不能为空!" ajaxurl="__URL__/checkTitle">
			</div>
		</div>
		<div class="form-item cf">
			<label class="item-label">节点标识：<span class="check-tips">（输入行为标识 英文字母）</span></label>
			<div class="controls">
				<INPUT TYPE="text" class="text input-large" NAME="name" value="{$vo.name}" datatype="*" nullmsg="节点标识不能为空!" ajaxurl="__URL__/checkName">
			</div>
		</div>
		<div class="form-item cf">
			<label class="item-label">节点规则：</label>
			<div class="controls">
				<label class="textarea">
        			<textarea name="condition" rows="" cols="" class="small">{$vo.condition}</textarea>
                </label>
			</div>
		</div>
		<div class="form-item cf">
			<label class="item-label">节点分组：</label>
			<div class="controls"><html:select name="group_id" id="group_id" selected="vo['group_id']" options="groupList" style="mws-select2 small" first="不分组" />
			</div>
		</div>
		<div class="form-item cf">
			<label class="item-label">作为菜单：</label>
			<div class="controls">
				<input name="is_menu" type="radio" value="1" id="is_menu1" onchange="detail(this.value);" <eq name="vo.is_menu" value="1"> checked="checked"</eq> /><label for="is_menu1">是</label>
                <input name="is_menu" type="radio" value="0" id="is_menu2" onchange="detail(this.value);" <neq name="vo.is_menu" value="1"> checked="checked"</neq> /><label for="is_menu2">否</label>
			</div>
		</div>
		<div class="form-item cf" <neq name="vo.is_menu" value="1"> style="display:none;"</neq>>
			<label class="item-label">是否显示：</label>
			<div class="controls">
				<input name="is_show" type="radio" value="1" id="is_show1" <neq name="vo.is_show" value="0"> checked="checked"</neq> /><label for="is_show1">是</label>
                <input name="is_show" type="radio" value="0" id="is_show2" <eq name="vo.is_show" value="0"> checked="checked"</eq> /><label for="is_show2">否</label>
			</div>
		</div>
		<div class="form-item cf">
			<label class="item-label">排序：</label>
			<div class="controls">
				<INPUT TYPE="text" class="text input-small" NAME="sort" value="{$vo.sort|default=0}">
			</div>
		</div> 
		<div class="form-item cf">
			<label class="item-label">节点说明：</label>
			<div class="controls">
				<label class="textarea">
        			<textarea name="remark" rows="" cols="" class="small">{$vo.remark}</textarea>
                </label>
			</div>
		</div>
		<div class="form-item">
			<INPUT TYPE="hidden" name="id" value="{$vo.id}">
			<INPUT TYPE="hidden" name="jumpurl" value="{$Think.server.HTTP_REFERER}">
			<button type="submit" class="btn submit-btn ajax-post" target-form="form-horizontal">确 定</button>
			<button class="btn btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
		</div>
	</FORM>
</block>
<block name="__body">
	<script type="text/javascript">
        function detail(d){
            d==1 ? $('#is_show').show() : $('#is_show').hide();
        }
        $(function(){
            $('#form1').Validform({
                tiptype:function(msg,o,cssctl){
                    if(!o.obj.is("form")){
                        var infoObj=o.obj.parent().find(".mws-error");
                        if (!infoObj || infoObj.length==0){
                            o.obj.after('<div class="mws-error"></div>');
                        }
                        infoObj=o.obj.parent().find(".mws-error");
                        if(o.type==2){
                            o.obj.removeClass('error');
                            infoObj.hide();
                        }else{
                            o.obj.addClass('error');
                            infoObj.html(msg).show();
                        }
                    }
                }
            });
        })
	</script>
</block>